/*
 *  MWPrint.cpp
 *  T3nsors
 *
 *  Created by Michael Barriault on 10-06-10.
 *  Copyright 2010 University of Guelph. All rights reserved.
 *
 */

#define HAVE_HDF

#include "MW.h"
#include <cmath>
#include <fstream>
#ifndef __APPLE__
#include <bbhutil.h>
#endif


void MW::Print(double t, Scalar C) {
	double *C2; C2 = &C[0];
	int O2[3];
	FORa O2[a] = O[a];
	double *xyz;
	xyz = new double[O[0]+O[1]+O[2]];
	FOR(i,O[0]) xyz[i] = x(0)(i,0,0);
	FOR(j,O[1]) xyz[O[0]+j] = x(1)(0,j,0);
	FOR(k,O[2]) xyz[O[0]+O[1]+k] = x(2)(0,0,k);
	std::string pid = id + "/" + C.id;
#ifndef __APPLE__
	gft_out_full((char*)pid.c_str(), t, O2, (char*)"x|y|z", 3, xyz, C2);
#endif
	delete xyz;
	return;
}

void MW::Print(double t, Vector V) {
	FOR(n,V.N) Print(t, V(n));
	return;
}


